package com.bicon.botu.mall.component.api;

import com.bicon.botu.mall.component.service.IHotSearchService;
import com.bicon.botu.core.base.common.controller.BaseController;
import com.bicon.botu.core.base.common.entity.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 热搜 前端控制器
 *
 * @author 张凡
 * @date 2017/7/19 下午 14:49
 */
@RestController
@CrossOrigin
@RequestMapping("/V1.0.0/api/hotSearch")
public class HotSearchApi extends BaseController {
    @Autowired
    IHotSearchService iHotSearchService;

    /**
     * 获取全部热搜详情
     *
     * @return
     */
    @RequestMapping(value = "/getHotSearchDetailFromRedis", method = RequestMethod.POST)
    public BaseResult getHotSearchDetailFromRedis(@RequestParam String type) {
        List<String> hotSearchList = iHotSearchService.getHotSearchDetailFromRedis(type);
        return sendResult(200, "获取成功", hotSearchList);
    }
}
